<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>后台管理-添加管理员</title>
		<link rel="stylesheet" href="../css/common.css">
		<link rel="stylesheet" href="../css/main.css">
		<script type="text/javascript" src="../js/jquery.min.js"></script>
		<!-- <script type="text/javascript">
			$(function() {
			});

			function findByAll() {
				$.get("../admin/findAll", null, function(data) {
					var str = "";
					$.each(data, function(index, item) {
						str += "<tr><td>" + item.aid + "</td><td>" + item.aname + "</td><td>" + item.tel +
							"</td><td><a href='javascript:resetPwd(" + item.aid + ")'>[重置密码]</a></td></tr>";
					});
					$("#admin_info").html("").append($(str));
				}, "json");
			}

			//function createTable(data,  )

			function addNewsTypeInfo() {
				var aname = $.trim($("#tname").val());
				var pwd = $.trim($("#pwd").val());
				var tel = $.trim($("#tel").val());

				if (aname == "") {
					alert("请输入管理员姓名...");
					return;
				}

				if (pwd == "") {
					alert("请输入管理员密码...");
					return;
				}

				if (tel == "") {
					alert("请输入管理员手机号码...");
					return;
				}

				$.post("../admin/add", {
					aname: aname,
					pwd: pwd,
					tel: tel
				}, function(data) {
					data = parseInt($.trim(data));
					if (data > 0) {
						$("#myform")[0].reset();
						findByAll();
					} else {
						alert("管理员信息添加失败，请稍后重试...");
					}
				}, "text");
			}

			function resetPwd(aid) {
				$.post("../admin/update", {
					aid: aid
				}, function(data) {
					data = parseInt($.trim(data));
					if (data > 0) {
						alert("管理员密码已重置为手机号码后 6 位，请提醒用户及时修改..");
					} else {
						alert("管理员密码重置失败...");
					}
				}, "text");
			}
		</script> -->
	</head>
	<body>
		<div id="forms" class="mt10">
			<div class="box">
				<div class="box_border">
					<div class="box_center">
						<!-- <table id="type">
							<tr>
								<td>真实姓名:<input type="text" id="realName" class="input-text lh30" size="40" /></td>
								<td>&nbsp;&nbsp;&nbsp;&nbsp;昵称:&nbsp;&nbsp;&nbsp;<input type="text" id="nickName " class="input-text lh30" size="40" /></td>
							</tr>
							<tr>
								<td>&nbsp;&nbsp;&nbsp;&nbsp;密码:&nbsp;&nbsp;&nbsp;<input type="text" id="pwd" class="input-text lh30" size="40" /></td>
								<td>&nbsp;&nbsp;&nbsp;&nbsp;Emil:&nbsp;&nbsp;&nbsp;<input type="text" id="email " class="input-text lh30" size="40" /></td>
							</tr>
							<tr>
								<td>电话号码:<input type="text" id="photo" class="input-text lh30" size="40" /></td>
								<td>注册日期:<input type="text" id="regDate " class="input-text lh30" size="40" /></td>
							</tr>
							<tr>
								<td colspan="2"><input type="button" name="button" class="btn btn82 btn_save2"
										onclick="addNewsWelcome()" value="添加" /></td>
							</tr>
						</table>
 -->
					</div>
				</div>
			</div>
		</div>

		<div id="table" class="mt10">
			<div class="box span10 oh">
				<table width="100%" border="0" cellpadding="0" cellspacing="0" class="list_table">
					<thead>
						<tr>
							<th width="10%">书籍图片</th>
							<th width="10%">书籍编号</th>
							<th width="10%">书籍名称</th>
							<th width="10%">作者</th>
							<th width="10%">出版社</th>
							<th width="10%">ISBN</th>
							<th width="10%">价格</th>
							<th width="10%">库存</th>
							<th width="10%">简介</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody id="admin_info" align="center">

					</tbody>
				</table>
			</div>
		</div>
	</body>
</html>
